<!--
 * @Author: your name
 * @Date: 2021-05-07 14:43:23
 * @LastEditTime: 2021-05-07 14:54:52
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \vue01d:\HTML001\布局小技巧\练习\input切换.html
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div #app>
      <button>切换</button>
      <template>
        <label for="" v-if="bool">
          <input type="text" />
        </label>
      </template>
      <template>
        <label for="" v-if="bool">
          <input type="text" />
        </label>
      </template>
    </div>
    <!-- 因为vue为了提升性能所以会极尽所能的利用覆盖资源，所以要加一个key，保证key的不同 -->
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>

    <script>
      new Vue({
        data() {
          return {
            dool: ture,
          };
        },
      });
    </script>
  </body>
</html>
